package com.itheima.controller;

import com.itheima.service.OmsOrderService;
import com.itheima.service.OmsService;
import com.itheima.vo.MinioVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

/**
 * @author 芝士雪豹
 * @create 2022/10/15/0:18
 */
@RestController
@RequestMapping("/aliyun")
public class OmsController {
    @Autowired
    private OmsService omsService;

    //文件上传
    @PostMapping("/oss/upload")
    public ResponseEntity upload(@RequestBody MultipartFile file) {
        MinioVo vo = omsService.upload(file);
        return ResponseEntity.ok(vo);
    }

}
